package com.project.UI;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;

import com.example.mybaseproject.R;
import com.project.UI.MainLeftFragment.OnSelectedListener;
import com.project.UI.news.NewsFragment;
import com.support.slidingmenu.SlidingMenu;
import com.support.slidingmenu.app.SlidingFragmentActivity;

public class MainSliActivity extends SlidingFragmentActivity implements OnSelectedListener {
	private SlidingMenu slidingMenu;
	private FragmentManager fm = getSupportFragmentManager();
	private FragmentTransaction ft;
	private Fragment contentFragment;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setBehindContentView(R.layout.activity_main_center_layout);
		setContentView(R.layout.activity_main_left_layout);
		ft = fm.beginTransaction();
		contentFragment = new NewsFragment();
		ft.add(contentFragment, "news");
	}

	@Override
	protected void onStart() {
		super.onStart();
	}

	@Override
	protected void onResume() {
		super.onResume();
	}

	@Override
	protected void onPause() {
		super.onPause();
	}

	@Override
	protected void onResumeFragments() {
		super.onResumeFragments();
	}

	private void initSlidingMenu() {
		slidingMenu = getSlidingMenu();
		slidingMenu.attachToActivity(this, SlidingMenu.LEFT);
		slidingMenu.setAboveOffsetRes(R.dimen.sliding_offset);
		slidingMenu.setBehindScrollScale(0f);
		slidingMenu.setSlidingEnabled(true);
	}

	@Override
	public void selectedListener() {

	}
}
